package com.dpiinc.TechPage.room.dao;

import com.dpiinc.TechPage.room.bean.UserEntity;

import java.util.List;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

/**
 * Created by hu489_000 on 2018-07-01.
 */

@Dao
public interface UserDao {

    @Query("SELECT * FROM UserEntity")
    List<UserEntity> getAll();

    @Query("SELECT * FROM UserEntity WHERE uid IN (:uids)")
    List<UserEntity> getAllByIds(long[] uids);

    @Insert
    void insert(UserEntity... entities);

    @Query("DELETE FROM UserEntity")
    public void clearTable();

    @Delete
    void delete(UserEntity entity);

    @Update
    void update(UserEntity entity);
}
